package prv.pursuivant.config;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import prv.pursuivant.core.AchievTypesTree;

/**
 * 
 * Interface common for serializing tree of achievement types. Can be factory,
 * can be file reader/writer
 * 
 * @author Kwinto
 * @see Config
 * 
 */

public interface CategorySerializer {

	/**
	 * Reads configuration
	 * 
	 * @param stream
	 *            stream with configuration data
	 * 
	 * @return tree read
	 * @throws IOException
	 */
	AchievTypesTree readTree(InputStream stream) throws IOException;

	/**
	 * Writes tree
	 * 
	 * @param tree
	 *            tree to be written
	 * @throws IOException
	 */
	void writeTree(AchievTypesTree tree, OutputStream stream)
			throws IOException;

}
